vulkan: Optionally share one JSON manifest per driver between architectures
authorSimon McVittie <smcv@debian.org>
Thu, 25 Sep 2025 13:01:25 +0000 (21:01 +0800)
committerTimo Aaltonen <tjaalton@debian.org>
Wed, 7 Jan 2026 12:26:39 +0000 (14:26 +0200)
commitf4d5d8d4ca47d9c1317be58e360b9e18d99bcc5e
tree210c1d19f8a773ddbcb0d1537698ce24990856d4
parent4d06c3dfb4e402ef685c2538c04106f7a284d9f3
vulkan: Optionally share one JSON manifest per driver between architectures

If the library_path is just a basename like `libvulkan_lvp.so`, then we
can share the same JSON manifest like `lvp_icd.json` between all of the
architectures, like we already do for Vulkan layers. The library will
be looked up in the dynamic linker's default search path in this case,
and in practice will be found in `${libdir}`. This is how the Mesa's
EGL driver and Vulkan layers work, how Mesa is packaged in Debian 13,
and also how the Nvidia proprietary driver works; it makes installation
simpler for distros, especially on multiarch systems like Debian and
the freedesktop.org SDK.

However, if we want a separate manifest per architecture in order to
be able to write the full path into it, we still need per-architecture
filename disambiguation like `lvp_icd.x86_64.json`.

We presumably still want a separate per architecture on Windows, because
the concept of a single monolithic `${libdir}` is less common there, and
it can also be helpful during development when setting `$VK_DRIVER_FILES`
to force the use of a specific driver installed in a non-default location.

Use the following parameter to passed to vk_icd_gen:
'--icd-lib-path', vulkan_icd_lib_path,
'--icd-filename', icd_file_name,
output : 'virtio_icd.' + vulkan_manifest_suffix,

and the output is passed by '--out', '@OUTPUT@',
so we can detect vulkan_manifest_per_architecture from the --out parameter in script.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13745
Signed-off-by: Simon McVittie <smcv@collabora.com>
Co-authored-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37314>
Applied-upstream: 26.0, commit:b860ae309a42dce317d275000016abc2b4ebe687

Gbp-Pq: Name vulkan-Optionally-share-one-JSON-manifest-per-driver-betw.patch
16 files changed:
meson.build
meson.options
src/amd/vulkan/meson.build
src/asahi/vulkan/meson.build
src/broadcom/vulkan/meson.build
src/freedreno/vulkan/meson.build
src/gallium/targets/lavapipe/meson.build
src/gfxstream/guest/vulkan/meson.build
src/imagination/vulkan/meson.build
src/intel/vulkan/meson.build
src/intel/vulkan_hasvk/meson.build
src/microsoft/vulkan/meson.build
src/nouveau/vulkan/meson.build
src/panfrost/vulkan/meson.build
src/virtio/vulkan/meson.build
src/vulkan/util/vk_icd_gen.py